define(['app'],function(app){return {module: function($scope, $http, eventBusService, httpService, params) {

		$scope.form.father_id=params.father_id;

		//行政区划码
		httpService.post(app.urls.dictionary_selectByRule,{fk_rule:"SJAAAAA33","order_phonetic":"true"},function(data){
			if("0000" === data.code){
				$scope.roadList = data.data;
			}else{
				alert(data.msg);
			}
		});
		//经济属性码
		httpService.post(app.urls.dictionary_selectByRule,{fk_rule:"SJAAAAA10"},function(data){
			if("0000" === data.code){
				$scope.nationList = data.data;
			}else{
				alert(data.msg);
			}
		});
		//类别代码
		httpService.post(app.urls.dictionary_selectByRule,{fk_rule:"SJAAAAA4"},function(data){
			if("0000" === data.code){
				$scope.szdlbList = data.data;
			}else{
				alert(data.msg);
			}
		});
		//民族属性
		httpService.post(app.urls.dictionary_selectByRule,{fk_rule:"SJAAAAA9"},function(data){
			if("0000" === data.code){
				$scope.nationalityList = data.data;
			}else{
				alert(data.msg);
			}
		});
		$scope.saveForm = function(){
			if($scope.formCheck()) {
				httpService.post(app.urls.unit_insertCenter,$scope.form,function(data){
					if("0000" === data.code){
						$scope.goback();
					}else{
						alert(data.msg);
					}
				});
			}
		}
		//所属省份
		httpService.post(app.urls.dictionary_selectByRule,{fk_rule:"SJAAAAA31"},function(data){
			if("0000" === data.code){
				$scope.provinceList = data.data;
			}else{
				alert(data.msg);
			}
		});
		//所属市/区
		$scope.findCity = function(father_id){
			httpService.post(app.urls.dictionary_selectByRule,{fk_rule:"SJAAAAA32","father_id":father_id},function(data){
				if("0000" === data.code){
					$scope.cityList = data.data;
				}else{
					alert(data.msg);
				}
			});
		}
		//所属区县
		$scope.findDistrict= function(father_id){
			httpService.post(app.urls.dictionary_selectByRule,{fk_rule:"SJAAAAA33","father_id":father_id},function(data){
				if("0000" === data.code){
					$scope.districtList = data.data;
				}else{
					alert(data.msg);
				}
			});
		}
		//返回
		$scope.goback = function(){
			var menu = {};
			menu.url = "modules/content/unitmanagement/department/list?fk_menuid="+params.fk_menuid+"&father_id="+params.father_id;
			eventBusService.publish("modules.content.load",menu);
		}
	}}});